import bundleManager from '@ohos.bundle.bundleManager';
import hilog from '@ohos.hilog';

let bundleFlags = bundleManager.BundleFlag.GET_BUNDLE_INFO_DEFAULT;


export const bundleInfo = async () =>{
    try {
      const {versionName,name,targetVersion,versionCode}  = await bundleManager.getBundleInfoForSelf(bundleFlags)
      return {versionName,name,targetVersion,versionCode}
    } catch (err) {
      hilog.error(0x0000, 'testTag', 'getBundleInfoForSelf failed: %{public}s', err.message);
    }
  }
